<template>
	<view>
		
		<view v-if="active==0">
			<Menus :menu="menus"></Menus>
		</view> 
		<view v-if="active==1">
			<Approval></Approval>
		</view>
		<view v-if="active==2">
			<Record></Record>
		</view>
		
		<van-tabbar  v-model="active" @change="onChange" fixed :placeholder="true">
		    <van-tabbar-item icon="home-o">
		        <span>发起申请</span>
		        <template #icon="props">
		           <img :src="props.active ? '../../mobile/static/images/icon11.png' : '../../mobile/static/images/icon12.png'" /> 
		        </template>
		    </van-tabbar-item>
		    <van-tabbar-item icon="search">
		        <span>我审批的</span>
		        <template #icon="props"> 
		            <img :src="props.active ? '../../mobile/static/images/icon21.png' : '../../mobile/static/images/icon22.png'" /> 
		        </template>
		    </van-tabbar-item> 
			<van-tabbar-item icon="search">
			    <span>已提交</span>
			    <template #icon="props">
			        <img :src="props.active ? '../../mobile/static/images/icon31.png' : '../../mobile/static/images/icon32.png'" /> 
			    </template>
			</van-tabbar-item> 
		</van-tabbar>
	</view>
</template>

<script setup>
	 import {ref} from "vue"
	 import Menus from "./menus"
	 import Approval from "../approval/index"
	 import Record from "./record"
	 import {onLoad} from "@dcloudio/uni-app"
	 const active = ref(0)
	 const onChange =(e) =>{ 
		 active.value=e
	 }
	 const list=ref([
		 {name:'请假',path:"/pages/vacation/vacation"},
		 {name:'加班',path:"/pages/vacation/warkOvertime"},
		 {name:'出差',path:""},
	 ])
	 const list1=ref([
	 		 {name:'补卡',path:""}, 
	 ])
	 const list2=ref([
	 		 {name:'调入调出',path:"/pages/mobilize/index"},
	 		 {name:'晋升',path:"/pages/promotion/index"},
	 		 {name:'离职申请',path:""},
	 ])
	 const routeTo=(url)=>{
	  uni.navigateTo({
	     url:url,
	  })
	 }
	 const menus=ref('')
	 onLoad(async()=>{
		 let menu = await uni.getStorageSync('mensu')
		 menus.value=JSON.parse(menu) 
		 console.log(menus.value)
		 
	 })
</script>

<style scoped lang="scss">
.con{
	width:700rpx;
	margin: 30rpx auto;
	background: #fff;
	.title{
		padding:15rpx;
		background: #fff;
		font-size: 28rpx;
		font-family: Source Han Sans, Source Han Sans;
		font-weight: 700;
		color: #3D3D3D; 
	}
}
</style>
